#define _CRT_SECURE_NO_WARNINGS
#include"BinaryTree.h"

BTNode* CreatTree2()
{
	BTNode* n1 = BuyBTNode(1);
	BTNode* n2 = BuyBTNode(2);
	BTNode* n3 = BuyBTNode(3);
	BTNode* n4 = BuyBTNode(4);
	BTNode* n5 = BuyBTNode(5);
	BTNode* n6 = BuyBTNode(6);
	BTNode* n7 = BuyBTNode(7);
	BTNode* n8 = BuyBTNode(8);

	n1->left = n2;
	n1->right = n4;
	n2->left = n3;
	n3->left = n7;
	n7->right = n8;
	n4->right = n6;
	n4->left = n5;

	return n1;
}


void Test2()
{
	BTNode* root = CreatTree2();

	int size = TreeSize(root);
	printf("size = %d\n", size);

	int height = TreeHeight(root);
	printf("height = %d\n", height);

	int k = TreeSizeK(root, 4);
	printf("Ksize = %d\n", k);

	BTNode* ret = TreeFind(root, 10);
	if (ret == NULL)
	{
		printf("NO\n");
	}
	else
	{
		printf("YES\nret_val = %d", ret->data);
	}

	bool flag = TreeCompelet(root);
	if (flag)
	{
		printf("Compelet Yes\n");
	}
	else
	{
		printf("Compelet NO\n");
	}
}

//int main()
//{
//	Test2();
//	return 0;
//}